package com.cx.mall.search.controller;

import com.cx.mall.common.model.search.SkuEs;
import com.cx.mall.common.utils.ResponseVO;
import com.cx.mall.search.service.ISkuEsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/search/skuEs")
public class SkuEsController {
    @Autowired
    private ISkuEsService skuEsService;
    @GetMapping("/importAll")
    public ResponseVO importAll() {
        skuEsService.saveAll();
        return ResponseVO.success();
    }

    @PostMapping("/save")
    public ResponseVO save(@RequestBody SkuEs skuEs) {
        skuEsService.save(skuEs);
        return ResponseVO.success();
    }

    @DeleteMapping("/delete/{id}")
    public ResponseVO delete(@PathVariable String id) {
        skuEsService.deleteById(id);
        return ResponseVO.success();
    }


}
